<template>
  <div>
      <!-- 三级联动全局组件  已经注册为全局组件了，不需要再引入 -->
      <TypeNav/>
      <!-- 轮播图列表 -->
      <ListContainer/>
      <!-- 今日推荐 -->
      <Recommend/>
      <!-- 商品排行 -->
      <Rank/>
      <!-- 猜你喜欢 -->
      <Like/>
      <!-- 楼层 -->
      <Floor v-for="floor in floorList" :key="floor.id" :list='floor'/>
      <!-- 商标 -->
      <Brand/>
  </div>
</template>

<script>
import ListContainer from '@/pages/Home/ListContainer'
import Recommend from '@/pages/Home/Recommend'
import Rank from '@/pages/Home/Rank'
import Like from '@/pages/Home/Like'
import Floor from '@/pages/Home/Floor'
import Brand from '@/pages/Home/Brand'
import {mapState} from 'vuex'
export default {
    name:'Home',
    components:{ListContainer,Recommend,Rank,Like,Floor,Brand},
    computed:{
      ...mapState({floorList:state=>state.home.floorList})
    },
    mounted () {
    //派发action捞取楼层数据
    this.$store.dispatch('getFloorList')
  },
}
</script>

<style>

</style>